home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigantic Games 2
/
Gigantic Games 2.iso
/
pc
/
_d_
/
dogfight!
/
sources.lha
/
DogFight!_1.0.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-16
|
4KB
|
122 lines
/********************************************************************
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
##
## Dogfight!4.h
##
## DogFight! definitions and globals.
##
## v0.0 24-Feb-94
##
## v0.4 26-Feb-94 added MUI & doublebuffering
## v0.5 28-Feb-94 changed input to direct keyboard read
## v0.6 28-FEB-94 added screenmode requester
##
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
*********************************************************************/
#ifndef DOGFIGHT_H
#define DOGFIGHT_H
#endif
#include <string.h>
#include <stddef.h>
#include <intuition/intuition.h>
#include <libraries/mathffp.h>
#include <clib/graphics_protos.h>
#include <clib/intuition_protos.h>
#include <clib/mathffp_protos.h>
#include <clib/mathtrans_protos.h>
#include <clib/alib_protos.h>
// macros & stuff
#ifndef MAKE_ID
#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
#endif
LONG __stack = 9000;
// error IDs
enum {ER_none, ER_GTL, ER_OS1, ER_GVI1,
ER_OS2, ER_GVI2, ER_ASBS,
ER_ASBC, ER_WIN1, ER_MATHTRANS,
ER_MATHFFP, ER_DBMP, ER_UPMP,
ER_WIN2, ER_APP, ER_MUIMAST, ER_CMSGPORT,
ER_CSTDIO, ER_OKBD, ER_ALLOCASL, ER_OPENASL,
ER_ASLBASE, ER_ALOCMBPTR,
ER_OPENMBWND, ER_BITMAP, ER_PLANEPTR,
ER_GRAPHICS, ER_INTUITION,
ER_ALLOCMEM};
// error string definitions
const char *ERRORS[] =
{"None", "Open GadToolsLibrary", "Open Screen 1", "Get VisualInfo 1",
"Open Screen 2", "Get VisualInfo 2", "Allocate ScreenBuffer Screen",
"Allocate ScreenBuffer Copy", "Open window 1", "Open MathTrans.library v37",
"Open MathFFP.library v39", "Create dbuf MsgPort", "Create user MsgPort",
"Open Window 2", "Open app", "Open MUIMaster.library", "Create MsgPort",
"Create StdIO", "Open keyboard.device", "Allocate ASL", "Open ASL",
"Open asl.library v39", "Allocate blank mouse pointer",
"Open blank mouse window", "Allocate BitMap", "Allocate PlanePTR",
"Open graphics.lirbrary v39", "Open intuition.library v39",
"Allocate memory"};
const char *SNDERRORS[] = {"No error", "Open sound file",
"Read sound file", "Get audio channel", "Allocate memory"};
enum {PLAYER1, PLAYER2, PLAYER3, PLAYER4};
// predefine the screen sizes (they'll probably get changed later by the user)
ULONG scrn_width_MAX = 640;
ULONG scrn_height_MAX = 512;
ULONG scrn_left, scrn_right, scrn_top, scrn_bottom;
// text descriptions of the Jet controls (with MUI text formatting commands)
const char *controls[] = {
"\033cLeft: <\nFire: y\nRight: x",
"\033cLeft: b\nFire: n\nRight: m",
"\033cLeft: ö\nFire: ä\nRight: #",
"\033cLeft: 1\nFire: 2\nRight: 3",
NULL };
// for the MUI prefs window:
//-------the pages
const char *pages[] = {"1", "2", "3", "4", NULL};
//-------the radio buttons for each player
const char *radbutts[] = {"Compromise", "Speed",
"Manueverability", NULL};
//-------who is controlling the jet?...
const char *control[] = {"Not in play", "Human", "Hector", NULL};
//-------pointers to the various MUI objects that we watch
APTR app, WI_setup, RG_main, RA_player[4], CY_player[4], BU_go;
APTR TO_gameover, CH_speed, BU_quit, BU_save;
APTR CH_vuln;
// MUI button and menu return IDs
enum {ID_none, ID_gobutton, ID_save, ID_quit, ID_about, ID_screen};
// this is for the number in each Jet
struct TextAttr topaz8 = {( STRPTR )"topaz.font", 8, 0x00, 0x01 };
struct IntuiText PLT[] = {
{2, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"1", NULL },
{3, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"2", NULL },
{4, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"3", NULL },
{5, 0, JAM1, 0, 0, &topaz8, (UBYTE *)"4", NULL }};
// speeds for each game setting. The first number (in each array)
// is for the "slow" setting (slidebar game_speed = 0), the second
// for the fast setting.
int game_speed = 0; // set by the slidebar
BOOL vulnerability = FALSE; // starting invuln. initializer
const int slow[] = {2, 3}; // for a manueverable Jet
const int medium[] = {3, 4}; // for a compromise Jet
const int fast[] = {4, 6}; // for a speed Jet
const int shotspeed[] = {8, 10}; // how fast the shot moves
// for the scores text in the prefs window
char scores[125];
// this is where the keyboard status gets put by DoIO (for Jet control)
UBYTE buff[16];